<?php

namespace app\models;

/**
 * This is the model class for table "{{%contacts_data}}".
 *
 * @property int $contacts_id
 * @property int $country_id 国家
 * @property int $province_id 省份
 * @property int $city_id 城市
 * @property int $district_id 区县
 * @property string|null $stree 详细街道
 * @property string $description 备注
 * @property string|null $ext_json 扩展字段
 */
class ContactsData extends ActiveRecord
{

    public static function tableName()
    {
        return '{{%contacts_data}}';
    }

    public function rules()
    {
        return [
            [
                [
                    'contacts_id',
                    'country_id',
                    'province_id',
                    'city_id',
                    'district_id',
                    'description',
                    'ext_json',
                    'street'
                ],
                'safe'
            ],
        ];
    }

    public function attributeLabels()
    {
        return [
            'contacts_id' => 'Contacts ID',
            'country_id' => '国家',
            'province_id' => '省份',
            'city_id' => '城市',
            'district_id' => '区县',
            'stree' => '详细街道',
            'description' => '备注',
            'ext_json' => '扩展字段',
        ];
    }

    /**
     * 批量插入字段
     * @return array
     */
    public static function columns()
    {
        return [
            'country_id',
            'province_id',
            'city_id',
            'district_id',
            'stree',
            'description',
            'ext_json',
        ];
    }

    public static function primaryKey()
    {
        return ['contacts_id'];
    }
}